<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>判断一个对象是否为空对象</title>
</head>

<body>
  <!-- https://zhuanlan.zhihu.com/p/52684391 -->
  <!-- 首推 JSON.stringify -->
</body>
<script>
  "use strict"; {
    let value = { a: 12, b: 12 };
    if (JSON.stringify(value) == "{}") console.log(`空对象`);
    console.log(JSON.stringify(value, null, 2));
  };
</script>

</html>